﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using CodeFarmer.Model.Entities;

namespace CodeFarmer.Model.Mapping
{
    public class CommentMap : EntityTypeConfiguration<Comment>
    {
        public CommentMap()
        {
            this.HasKey(t => t.ArticleID);

            this.Property(t => t.Content).IsRequired();

            this.Property(t => t.CreateTime).IsRequired();

            this.ToTable("Comment");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.AuthorID).HasColumnName("AuthorID");
            this.Property(t => t.Content).HasColumnName("Content");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.EditTime).HasColumnName("EditTime");
            this.Property(t => t.UpCount).HasColumnName("UpCount");
            this.Property(t => t.State).HasColumnName("State");
        }
    }
}
